using HKB.Common;
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Diagnostics;
namespace HKB.Data.Dal.S_FShopClassTableAdapters
{
	[GeneratedCode("System.Data.Design.TypedDataSetGenerator", "2.0.0.0"), DataObject(true), HelpKeyword("vs.data.TableAdapter"), Designer("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), DesignerCategory("code"), ToolboxItem(true)]
	public class HLShop_FShopClassTableAdapter : Component
	{
		private SqlDataAdapter _adapter;
		private SqlConnection _connection;
		private SqlCommand[] _commandCollection;
		private bool _clearBeforeFill;
		[System.Diagnostics.DebuggerNonUserCode]
		private SqlDataAdapter Adapter
		{
			get
			{
				if (this._adapter == null)
				{
					this.InitAdapter();
				}
				return this._adapter;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		internal SqlConnection Connection
		{
			get
			{
				if (this._connection == null)
				{
					this.InitConnection();
				}
				return this._connection;
			}
			set
			{
				this._connection = value;
				if (this.Adapter.InsertCommand != null)
				{
					this.Adapter.InsertCommand.Connection = value;
				}
				if (this.Adapter.DeleteCommand != null)
				{
					this.Adapter.DeleteCommand.Connection = value;
				}
				if (this.Adapter.UpdateCommand != null)
				{
					this.Adapter.UpdateCommand.Connection = value;
				}
				for (int i = 0; i < this.CommandCollection.Length; i++)
				{
					if (this.CommandCollection[i] != null)
					{
						this.CommandCollection[i].Connection = value;
					}
				}
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		protected SqlCommand[] CommandCollection
		{
			get
			{
				if (this._commandCollection == null)
				{
					this.InitCommandCollection();
				}
				return this._commandCollection;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		public bool ClearBeforeFill
		{
			get
			{
				return this._clearBeforeFill;
			}
			set
			{
				this._clearBeforeFill = value;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		public HLShop_FShopClassTableAdapter()
		{
			this.ClearBeforeFill = true;
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitAdapter()
		{
			this._adapter = new SqlDataAdapter();
			DataTableMapping dataTableMapping = new DataTableMapping();
			dataTableMapping.SourceTable = "Table";
			dataTableMapping.DataSetTable = "HLShop_FShopClass";
			dataTableMapping.ColumnMappings.Add("F_ShopClassID", "F_ShopClassID");
			dataTableMapping.ColumnMappings.Add("F_ShopClassName", "F_ShopClassName");
			dataTableMapping.ColumnMappings.Add("UserID", "UserID");
			dataTableMapping.ColumnMappings.Add("F_ShopClassRemark", "F_ShopClassRemark");
			this._adapter.TableMappings.Add(dataTableMapping);
			this._adapter.InsertCommand = new SqlCommand();
			this._adapter.InsertCommand.Connection = this.Connection;
			this._adapter.InsertCommand.CommandText = "INSERT INTO [HLShop_FShopClass] ([F_ShopClassID], [F_ShopClassName], [UserID], [F_ShopClassRemark]) VALUES (@F_ShopClassID, @F_ShopClassName, @UserID, @F_ShopClassRemark)";
			this._adapter.InsertCommand.CommandType = CommandType.Text;
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@F_ShopClassID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "F_ShopClassID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@F_ShopClassName", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "F_ShopClassName", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@UserID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "UserID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@F_ShopClassRemark", SqlDbType.Text, 0, ParameterDirection.Input, 0, 0, "F_ShopClassRemark", DataRowVersion.Current, false, null, "", "", ""));
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitConnection()
		{
			this._connection = new SqlConnection();
			this._connection.ConnectionString = Conn.CurrenConnectionStrings;
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitCommandCollection()
		{
			this._commandCollection = new SqlCommand[6];
			this._commandCollection[0] = new SqlCommand();
			this._commandCollection[0].Connection = this.Connection;
			this._commandCollection[0].CommandText = "SELECT F_ShopClassID, F_ShopClassName, UserID, F_ShopClassRemark\r\nFROM HLShop_FShopClass";
			this._commandCollection[0].CommandType = CommandType.Text;
			this._commandCollection[1] = new SqlCommand();
			this._commandCollection[1].Connection = this.Connection;
			this._commandCollection[1].CommandText = "PR_DeleteFShopClass";
			this._commandCollection[1].CommandType = CommandType.StoredProcedure;
			this._commandCollection[1].Parameters.Add(new SqlParameter("@RETURN_VALUE", SqlDbType.Int, 4, ParameterDirection.ReturnValue, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[1].Parameters.Add(new SqlParameter("@F_ShopClassID", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[2] = new SqlCommand();
			this._commandCollection[2].Connection = this.Connection;
			this._commandCollection[2].CommandText = "SELECT F_ShopClassID, F_ShopClassName, UserID, F_ShopClassRemark\r\nFROM HLShop_FShopClass where  F_ShopClassID=@F_ShopClassID";
			this._commandCollection[2].CommandType = CommandType.Text;
			this._commandCollection[2].Parameters.Add(new SqlParameter("@F_ShopClassID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "F_ShopClassID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[3] = new SqlCommand();
			this._commandCollection[3].Connection = this.Connection;
			this._commandCollection[3].CommandText = "SELECT F_ShopClassID, F_ShopClassName, UserID, F_ShopClassRemark\r\nFROM HLShop_FShopClass where UserID=@UserID";
			this._commandCollection[3].CommandType = CommandType.Text;
			this._commandCollection[3].Parameters.Add(new SqlParameter("@UserID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "UserID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[4] = new SqlCommand();
			this._commandCollection[4].Connection = this.Connection;
			this._commandCollection[4].CommandText = "INSERT INTO [HLShop_FShopClass] ( [F_ShopClassName], [UserID], [F_ShopClassRemark]) VALUES (  @F_ShopClassName, @UserID, @F_ShopClassRemark)";
			this._commandCollection[4].CommandType = CommandType.Text;
			this._commandCollection[4].Parameters.Add(new SqlParameter("@F_ShopClassName", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, "F_ShopClassName", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[4].Parameters.Add(new SqlParameter("@UserID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "UserID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[4].Parameters.Add(new SqlParameter("@F_ShopClassRemark", SqlDbType.Text, 2147483647, ParameterDirection.Input, 0, 0, "F_ShopClassRemark", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5] = new SqlCommand();
			this._commandCollection[5].Connection = this.Connection;
			this._commandCollection[5].CommandText = "UPDATE HLShop_FShopClass Set F_ShopClassName=@F_ShopClassName ,F_ShopClassRemark=@F_ShopClassRemark where F_ShopClassID=@F_ShopClassID";
			this._commandCollection[5].CommandType = CommandType.Text;
			this._commandCollection[5].Parameters.Add(new SqlParameter("@F_ShopClassName", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, "F_ShopClassName", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@F_ShopClassRemark", SqlDbType.Text, 2147483647, ParameterDirection.Input, 0, 0, "F_ShopClassRemark", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@F_ShopClassID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "F_ShopClassID", DataRowVersion.Original, false, null, "", "", ""));
		}
		[DataObjectMethod(DataObjectMethodType.Select, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_FShopClass.HLShop_FShopClassDataTable GetAllFShopClass()
		{
			this.Adapter.SelectCommand = this.CommandCollection[0];
			S_FShopClass.HLShop_FShopClassDataTable hLShop_FShopClassDataTable = new S_FShopClass.HLShop_FShopClassDataTable();
			this.Adapter.Fill(hLShop_FShopClassDataTable);
			return hLShop_FShopClassDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_FShopClass.HLShop_FShopClassDataTable GetFShopClassByFShopClassID(int F_ShopClassID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[2];
			this.Adapter.SelectCommand.Parameters[0].Value = F_ShopClassID;
			S_FShopClass.HLShop_FShopClassDataTable hLShop_FShopClassDataTable = new S_FShopClass.HLShop_FShopClassDataTable();
			this.Adapter.Fill(hLShop_FShopClassDataTable);
			return hLShop_FShopClassDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_FShopClass.HLShop_FShopClassDataTable GetFShopClassByUserID(int? UserID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[3];
			if (UserID.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[0].Value = UserID.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[0].Value = System.DBNull.Value;
			}
			S_FShopClass.HLShop_FShopClassDataTable hLShop_FShopClassDataTable = new S_FShopClass.HLShop_FShopClassDataTable();
			this.Adapter.Fill(hLShop_FShopClassDataTable);
			return hLShop_FShopClassDataTable;
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(S_FShopClass.HLShop_FShopClassDataTable dataTable)
		{
			return this.Adapter.Update(dataTable);
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(S_FShopClass dataSet)
		{
			return this.Adapter.Update(dataSet, "HLShop_FShopClass");
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(DataRow dataRow)
		{
			return this.Adapter.Update(new DataRow[]
			{
				dataRow
			});
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(DataRow[] dataRows)
		{
			return this.Adapter.Update(dataRows);
		}
		[DataObjectMethod(DataObjectMethodType.Insert, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Insert(int? F_ShopClassID, string F_ShopClassName, int? UserID, string F_ShopClassRemark)
		{
			if (F_ShopClassID.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[0].Value = F_ShopClassID.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[0].Value = System.DBNull.Value;
			}
			if (F_ShopClassName == null)
			{
				this.Adapter.InsertCommand.Parameters[1].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[1].Value = F_ShopClassName;
			}
			if (UserID.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[2].Value = UserID.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[2].Value = System.DBNull.Value;
			}
			if (F_ShopClassRemark == null)
			{
				this.Adapter.InsertCommand.Parameters[3].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[3].Value = F_ShopClassRemark;
			}
			ConnectionState state = this.Adapter.InsertCommand.Connection.State;
			if ((this.Adapter.InsertCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				this.Adapter.InsertCommand.Connection.Open();
			}
			int result;
			try
			{
				int num = this.Adapter.InsertCommand.ExecuteNonQuery();
				result = num;
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					this.Adapter.InsertCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Delete, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int DeleteFShopClass(int? F_ShopClassID)
		{
			SqlCommand sqlCommand = this.CommandCollection[1];
			if (F_ShopClassID.HasValue)
			{
				sqlCommand.Parameters[1].Value = F_ShopClassID.Value;
			}
			else
			{
				sqlCommand.Parameters[1].Value = System.DBNull.Value;
			}
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Insert, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int InsertFShopClass(string F_ShopClassName, int? UserID, string F_ShopClassRemark)
		{
			SqlCommand sqlCommand = this.CommandCollection[4];
			if (F_ShopClassName == null)
			{
				sqlCommand.Parameters[0].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[0].Value = F_ShopClassName;
			}
			if (UserID.HasValue)
			{
				sqlCommand.Parameters[1].Value = UserID.Value;
			}
			else
			{
				sqlCommand.Parameters[1].Value = System.DBNull.Value;
			}
			if (F_ShopClassRemark == null)
			{
				sqlCommand.Parameters[2].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[2].Value = F_ShopClassRemark;
			}
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Update, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int UpdateFShopClass(string F_ShopClassName, string F_ShopClassRemark, int F_ShopClassID)
		{
			SqlCommand sqlCommand = this.CommandCollection[5];
			if (F_ShopClassName == null)
			{
				sqlCommand.Parameters[0].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[0].Value = F_ShopClassName;
			}
			if (F_ShopClassRemark == null)
			{
				sqlCommand.Parameters[1].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[1].Value = F_ShopClassRemark;
			}
			sqlCommand.Parameters[2].Value = F_ShopClassID;
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
	}
}
